$(function() {
	$("#a").click(function(e){
		$("#wrap_loginbar2").lightbox_me({
			centered:true,
			onLoad: function() {}
	    });
		e.preventDefault();
	});
});

function checkloginForm(form) {
	if (form.username.value == "") {
	    alert( "Please enter your user name." );
	    form.username.focus();
	    return false ;
	 }
	
	if (form.password.value == "") {
	    alert( "Please enter your password." );
	    form.password.focus();
	    return false ;
	 }
	  return true ;
}

function checksignupForm(form) {
	if (form.username.value == "") {
	    alert( "Please enter your user name.");
	    form.username.focus();
	    return false;
	}
	
	if (form.email.value == "") {
	    alert( "Please enter your email address.");
	    form.email.focus();
	    return false;
	}
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = form.email.value;
	if(reg.test(address) == false) {
		alert('Invalid Email Address');
	    return false;
	}
	
	if (form.password.value == "") {
	    alert( "Please enter your password.");
	    form.password.focus();
	    return false;
	}
	
	if (form.month.value == "na") {
	    alert( "Select your birthday month.");
	    form.month.focus();
	    return false;
	}
	
	if (form.day.value == "na") {
	    alert( "Select your birthday day.");
	    form.day.focus();
	    return false;
	}
	
	if (form.year.value == "0") {
	    alert( "Select your birthday year.");
	    form.year.focus();
	    return false;
	}
	
	if (form.sex[0].checked == false && form.sex[1].checked == false) {
	    alert( "Select your gender.");
	    form.year.focus();
	    return false;
	}
	
	return true;
}

function formResetLogin() {
	document.getElementById("loginForm").reset();
}

function formResetSignup() {
	document.getElementById("signupForm").reset();
}
